;;;Place a Section Cut Symbol in the drawing at any orientation.
;;;Either one of US Army Corps of Engr or our standard.
;;;Uses UKWORD UPOINT MKLAYR SECLIN.DWG ELVCUT.DWG SECCUT.DWG
;;;
;;;	AUTHOR: HENRY C. FRANCIS
;;;		425 N. ASHE ST.
;;;		SOUTHERN PINES, NC 28387
;;;		All rights reserved without prejudice.
;;;	Copyright:	3-10-93
;;;	Edited:		4-7-01
;;;
(DEFUN C:SCS ( / clayr pt1 pt2 pt3 inss1 inss2 e1ang e2ang osin scsym orig_pt2)
  (setq cmde (getvar"cmdecho"))
  (setq old_osmode (getvar"osmode"))
  (setvar "cmdecho" 0)
  (setvar "osmode" 0)
  (IF ukword nil (LOAD "ukword" "\nFile UKWORD.LSP not loaded! "))
  (IF upoint nil (LOAD "upoint" "\nFile UPOINT.LSP not loaded! "))
  (if dimscl nil (load"dimscl"))
  (dimscl)
  (setq ntwang (- 0(*(/(getvar"viewtwist")pi)180)))
  (if prewh
    (setq whcht prewh
          prewh nil
    )
    (setq whcht (ukword 1 "CS CE Elevation Standard Q" "COE Section, COE Elevation, Elevation, Standard or Quick Section (CS,CE,E,S,Q)" (if whcht whcht "Standard")))
  )
  (cond
    ((eq (substr whcht 1 2) "CS")(setq scsym "seclin" osin T))
    ((eq (substr whcht 1 2) "CE")(setq scsym "elvcut" notail T))
    ((eq (substr whcht 1 1) "E")(setq scsym "elvcut" notail T))
    ((eq (substr whcht 1 1) "S")(setq scsym "seccut" osin NIL notail NIL))
    ((eq (substr whcht 1 1) "Q")(setq scsym "aasec1" osin NIL notail NIL))
  );cond
  (COND
    ((OR osin notail)
      (setq pt1 (getpoint "\nIntersection of Cut and Direction Lines")
            pt2 (upoint 1 "" "\nDirection of Cutting Line" nil pt1)
            pt3 (upoint 1 "" "\nDirection of Cut" nil pt1)
            pt1 (list(car pt1)(cadr pt1)(* dimsc 1001))
            pt2 (list(car pt2)(cadr pt2)(* dimsc 1001))
            pt3 (list(car pt3)(cadr pt3)(* dimsc 1001))
      )
    )
    ((EQ whcht "Standard")
      (setq pt1 (getpoint "\nCenter of Section Bubble")
            pt2 (upoint 1 "" "\nDirection of Cutting Line and location of tail" nil pt1)
            pt3 (upoint 1 "" "\nDirection of Cut" nil pt1)
            pt1 (list(car pt1)(cadr pt1)(* dimsc 1001))
            pt2 (list(car pt2)(cadr pt2)(* dimsc 1001))
            pt3 (list(car pt3)(cadr pt3)(* dimsc 1001))
      );setq
    )
    ((EQ whcht "Quick")
      (setq pt1 (getpoint "\nCorner of left Section Arrow Leader")
            pt2 (upoint 1 "" "\nDirection of Cutting Line and corner of right leader" nil pt1)
            pt3 (polar pt1 (+ (angle pt1 pt2)(/ pi 2.0)) 10)
            pt1 (list(car pt1)(cadr pt1)(* dimsc 1001))
            pt2 (list(car pt2)(cadr pt2)(* dimsc 1001))
            pt3 (list(car pt3)(cadr pt3)(* dimsc 1001))
      );setq
    )
  )
  (setq attdlg (getvar"attdia")
        inss1  dimsc
        e1ang (angle pt1 pt2)
        e2ang (angle pt1 pt2)
        prod "SECT"
        colr "1"
        modf "SYMB"
  );setq
  (if
    (or
      (and
        (<=(abs(-(angle pt1 pt2)(angle pt1 pt3)))pi)
        (>(angle pt1 pt2)(angle pt1 pt3))
      );and
      (and
        (>=(abs(-(angle pt1 pt2)(angle pt1 pt3)))pi)
        (<(angle pt1 pt2)(angle pt1 pt3))
      );and
    );or
    (setq inss2 (- 0.0 inss1) e1ang (+ e1ang pi))
    (setq inss2 inss1)
  );if
  (if osin
    (progn
      (setq pt1 (polar pt1 (+ e1ang (* 0.5 pi))(* inss1 0.625)))
      (setq pt2 (polar pt2 (+ e1ang (* 0.5 pi))(* inss1 0.625)))
    );progn
  );if
  (setvar "cmdecho" 0)
  (if c:mklayr nil (load"mklayr"))
  (if mjrg nil (setq mjrg "C"))
  (if llt nil (setq llt "-"))
  (if gvpno nil (load"gvpno"))
  (gvpno)
  (if modf nil (setq modf "SYMB"))
  (c:svlayr)
  (c:mklayr)
  (IF (NOT (EQ whcht "Quick"))
    (COND
      ((EQ whcht "Elevation")
         (command "insert" scsym pt1 (* inss1(/ 2.0 3.0))(* inss2(/ 2.0 3.0))(* 180.0 (/(+(angle pt1 pt3)(* 1.5 pi))pi))))
      (T (command "insert" scsym pt1 inss1 inss2 pt2))
    )
  )
  (IF (OR (EQ whcht "CS")(EQ whcht "CE")(EQ whcht "Quick")(EQ whcht "Elevation"))
    NIL
    (command ".insert" "sectail" pt2 inss1 inss2 (polar pt2 (angle pt1 pt2) 10))
  )
  (SETVAR "ATTREQ" 0)
  (command ".insert" (COND
                       ((OR(EQ whcht "CS")(EQ whcht "CE")) "b")
                       ((OR(EQ whcht "Standard")(EQ whcht "Elevation")) (IF(EQ(ATOI(GETVAR "ACADVER"))18) "ViewBubble-S" "B1"))
                       ((EQ whcht "Quick") "aasec1")
                     )
                     pt1
                     (IF(EQ(ATOI(GETVAR "ACADVER"))18) 1.0 inss1)
                     (IF(EQ(ATOI(GETVAR "ACADVER"))18) 1.0 inss1)
                     (COND
                       ((EQ whcht "Quick")(polar pt2 (angle pt1 pt2) 10))
                       (T ntwang)
                     )
                     (IF (EQ whcht "Quick")
                       "A"
                       ""
                     )
  );command
  (SETQ lastbub1 (ENTLAST))
  (IF (EQ whcht "Quick")
    (PROGN
      (command ".insert" "aasec2" pt2 inss1 inss1 (polar pt2 (angle pt1 pt2) 10)"A")
      (SETQ lastbub (ENTLAST))
      (command ".ddatte" lastbub)
    )
  )
  (command nil nil nil)
  (command ".ddatte" lastbub1)
  (c:rslayr)
  (SETVAR "ATTREQ" 1)
  (setvar "attdia" attdlg)
  (setvar "cmdecho" cmde)
  (setvar "osmode" old_osmode)
;;;  (command)
);defun c:scs
